#ifndef __device__H
#define __device__H

#ifdef __cplusplus
extern "C" {
#endif
#include "stm32f1xx_hal.h"


typedef struct {
    void *parent;
    void *p_data;

    int (*write)(unsigned char *, int);

    int (*read)(unsigned char *);

    int (*open)(char *name, char* mode, ...);

    void (*close)(void);

    void (*handler)(void);

    uint8_t* (*getSendBuf)(void);
    
    void (*UART_ErrorCallback)(UART_HandleTypeDef *huart);

    void (*UART_RxCpltCallback)(UART_HandleTypeDef *huart);

    void (*UART_TxCpltCallback)(UART_HandleTypeDef *huart);


} _UsartDevieStruct;



#ifdef __cplusplus
 }
#endif

#endif



